/*
-------------------------------------------------

	Demo.cpp

	Dmitriy Kuzmenko (Dgut)

-------------------------------------------------
*/

#include "Demo.h"
#include <windows.h>
#include <gl/gl.h>

namespace Autumn
{

const char * const WNDCLASS_NAME = "Demo";
const int WND_STYLE = /*WS_POPUP | WS_VISIBLE;//*//*WS_OVERLAPPEDWINDOW;*/WS_OVERLAPPED | WS_BORDER | WS_CAPTION | WS_VISIBLE | WS_SYSMENU;
const int WND_WIDTH = 800;//1024;
const int WND_HEIGHT = 600;//768;

const int VERSION = 100;

Game * const CreateGame( void )
{
	return new Demo();
}

}	// namespace Autumn

Autumn::Font * tahoma = 0;

/*
-------------------------------------------------

	Demo

-------------------------------------------------
*/

Demo::Demo( void )
{
}

Demo::~Demo( void )
{
}

const bool Demo::Init( void )
{
	if( !Game::Init() )
		return false;

	pGameScreen = new GameScreen();

	gAutumn.SetScreen( pGameScreen );

	tahoma = gAutumn.GetFont( "tahoma" );

	return true;
}

void Demo::Shutdown( void )
{
	delete pGameScreen;

	Game::Shutdown();
}

void Demo::Frame( void )
{
	Game::Frame();
}

void Demo::Draw( void ) const
{
	Game::Draw();

	gAutumn.SetOrthogonalProjection( gAutumn.Width(), gAutumn.Height() );

	gAutumn.SetFont( tahoma );
	gAutumn.Print( Autumn::Font::CENTER, Autumn::Font::MIDDLE, gAutumn.Width() / 2.f, gAutumn.Height() / 2.f, 0.25f, "Hello World!" );
}

/*
-------------------------------------------------

	GameScreen

-------------------------------------------------
*/

GameScreen * pGameScreen = 0;

GameScreen::GameScreen( void )
{
}

GameScreen::~GameScreen( void )
{
}

void GameScreen::Draw( void ) const
{
	gAutumn.Draw();
}

void GameScreen::Frame( void )
{
	gAutumn.Frame();
}